package brad.zimmerman.dungeon.game;

public class ClassAltar {
	
	int knowledge, ritual, god;
	boolean worshipped,ritual1, ritual2, ritual3;
	ClassAltar(int knowledge, int ritual, int god){
		this.god = god;
		this.knowledge = knowledge;
		this.ritual = ritual;
		this.worshipped = false;
		this.ritual1 = false;
		this.ritual2 = false;
		this.ritual3 = false;
	}
	public int getGod(){
		return this.god;
	}
	public void setGod(int value){
		this.god = value;
	}
	public void startWorship(){
		this.worshipped = true;
	}
	public ClassGameStats godsBlessing(ClassGameStats player, boolean curse){
		if (!curse){
			player.worshipGod = true;
			player.playerGod = god;
		}
		switch(this.god){
			case 1:
				player.undeadSlayer += (float) -.20;
				player.livingSlayer += (float) .10;
				return player;
			case 2:
				player.hpKillStealRate += (float) .10;
				return player;
			case 3:
				player.wallCreateBonus += 1;
				return player;
			case 4:
				player.moreMagic += (float) .20;
				player.enemyStrength += (float) -.10;
				return player;
			case 5:
				player.bloodSucker = (float) .05;
				player.player_health = 1;
				player.player_currenthealth = 1;
				player.tricksy = true;
				return player;
			case 6:
				player.deathHealthBonus += 1;
				player.killMaxMana = true;
				return player;
			case 7:
				player.undeadSlayer += (float) .20;
				player.livingSlayer += (float) -.10;
				return player;
			case 8:
				player.permModifier += (float) .5;
				player.player_mana = 1;
				player.player_currentmana = 1;
				return player;
			case 9:
				player.mPotionRefill += (float) .1; 
				//player.shopDiscount -= (float) .1;
				return player;
			case 10:
				player.physicalResistance += (float) .025;
				player.magicalResistance += (float) .025;
				return player;
			case 11:
				player.renewalRate += 1;
				player.benefitsPoison = true;
				return player;
			case 12:
				player.glyphBonus += (float) .50;
				player.moreMagic -= (float) .25;
				return player;
			case 13:
				player.player_currentmana = player.player_mana;
				player.glyphBonus = 0;
				return player;
			case 14:
				player.physicalResistance += (float) .1;
				player.magicalResistance -= (float) .05;
				return player;
			case 15:
				player.magicalResistance += (float) .1;
				player.physicalResistance -= (float) .05;
				return player;
			default:return player;
		}
		
	}
	
	public ClassGameStats godsRituals(ClassGameStats player, int ritual){
		if(ritual == 1 && !this.ritual1){
			this.ritual1 = true;
		}
		else if(ritual == 2 && !this.ritual2){
			this.ritual2 = true;
		}
		else if(ritual == 3 && !this.ritual3){
			this.ritual3 = true;
		}
		else{
			return player;
		}
		switch(this.god){
			case 1:
				switch(ritual){
					case 1:
						player.livingSlayer += (float) .45;
						break;
					case 2:
						player.livingSlayer += (float) .85;
						break;
					case 3:
						player.livingSlayer += (float) 1.6;
						break;
				}
				return player;
			case 2:
				switch(ritual){
					case 1:
						player.hpKillStealRate += (float) .40;
						break;
					case 2:
						player.hpKillEvolveRate += (float) 2;
						break;
					case 3:
						player.hpKillEvolveRate += (float) 5;
						break;
				}
				return player;
			case 3:
				switch(ritual){
					case 1:
						player.wallCreateBonus += 2;
						break;
					case 2:
						player.wallCreateBonus += 3;
						break;
					case 3:
						player.wallCreateBonus += 5;
						break;
				}
				return player;
			case 4:
				switch(ritual){
					case 1:
						player.player_mana += 15;
						break;
					case 2:
						player.benefitsBonus += (float) .40;
						break;
					case 3:
						player.tricksy = true;
						break;
				}
				return player;
			case 5:
				switch(ritual){
					case 1:
						player.twiceHit += (float) .10;
						break;
					case 2:
						player.lifeSteal += (float) .15;
						player.player_attack += 5;
						break;
					case 3:
						player.bloodSucker += (float) .5;
						player.player_attack += 10;
						break;
				}
				return player;
			case 6:
				switch(ritual){
					case 1:
						player.deathHealthBonus += 3;
						break;
					case 2:
						player.deathHealthBonus += 5;
						break;
					case 3:
						player.enemySightBonusHealth = 5;
						break;
				}
				return player;
			case 7:
				switch(ritual){
					case 1:
						player.undeadSlayer += (float) .45;
						break;
					case 2:
						player.undeadSlayer += (float) .85;
						break;
					case 3:
						player.undeadSlayer += (float) 1.6;
						break;
				}
				return player;
			case 8:
				switch(ritual){
					case 1:
						player.permModifier += (float) .75;
						break;
					case 2:
						player.permModifier += (float) 1.5;
						break;
					case 3:
						player.permModifier += (float) 3;
						break;
				}
				return player;
			case 9:
				switch(ritual){
					case 1:
						player.player_mana += 5;
						break;
					case 2:
						player.player_health += 25;
						break;
					case 3:
						player.mPotionRefill = 1; 
						player.hPotionRefill = 1;
						break;
				}
				return player;
			case 10:
				switch(ritual){
					case 1:
						player.physicalResistance += (float) .05;
						player.magicalResistance += (float) .05;
						break;
					case 2:
						player.physicalResistance += (float) .10;
						player.magicalResistance += (float) .10;
						break;
					case 3:
						player.physicalResistance += (float) .15;
						player.magicalResistance += (float) .15;
						break;
				}
				return player;
			case 11:
				switch(ritual){
					case 1:
						player.chanceCureAilments += (float) .05;
						player.renewalRate += 2;
						break;
					case 2:
						player.chanceCureAilments += (float) .15;
						player.renewalRate += 3;
						break;
					case 3:
						player.chanceCureAilments += (float) .30;
						player.renewalRate += 5;
						break;
				}
				return player;
			case 12:
				switch(ritual){
					case 1:
						player.glyphBonus += (float) .75;
						break;
					case 2:
						player.glyphBonus += (float) 1.25;
						break;
					case 3:
						player.glyphBonus += 2.50;
						break;
				}
				return player;
			case 13:
				switch(ritual){
					case 1:
						player.player_mana += 5;
						player.moreMagic += (float) .05;
						break;
					case 2:
						player.player_mana += 20;
						player.moreMagic += (float) .2;
						break;
					case 3:
						player.player_mana += 35;
						player.moreMagic += (float) .35;
						break;
				}
				return player;
			case 14:
				switch(ritual){
					case 1:
						player.physicalResistance += (float) .15;
						break;
					case 2:
						player.weaknessImmun = true;
						player.poisonedImmun = true;
						break;
					case 3:
						player.areaAttack = true;
						break;
				}
				return player;
			case 15:
				switch(ritual){
					case 1:
						player.magicalResistance += (float) .15;
						break;
					case 2:
						player.banishImmune = true;
						player.sHUDImmun = true;
						break;
					case 3:
						player.tricksy = true;
						break;
				}
				//"+5% Physical Resist","Weakness/Poison Immune","Atk hits all nearby enemies"},
				//"+5% Magic Resist","Banish/Static Immune","First Strike"}
				return player;
			default:return player;
		}
		
	}
}
